import base from "./base"; // 导入接口域名列表
import axios from "../http"; // 导入http中创建的axios实例
import qs from "qs"; // 根据需求是否导入qs模块

const getForm = {
  getBdList(params) {
    return axios.post(
      `${base.bd}/admin/bd_table/lists`,
      qs.stringify(params)
    );
  },
  saveeditBd(params){
    return axios.post(
        `${base.bd}/admin/bd_table/saveedit`,
        qs.stringify(params)
      );
  },
  addBd(params){
    return axios.post(
        `${base.bd}/admin/bd_table/saveadd`,
        qs.stringify(params)
      );
  },
  delBd(params){
    return axios.post(
        `${base.bd}/admin/bd_table/del`,
        qs.stringify(params)
      );
  },
  getFieldList(params){
    return axios.post(
      `${base.bd}/admin/bd_field/lists`,
      qs.stringify(params)
    );
  },
  delField(params){
    return axios.post(
      `${base.bd}/admin/bd_field/del`,
      qs.stringify(params)
    );
  },
  saveField(params){
    return axios.post(
      `${base.bd}/admin/bd_field/saveedit`,
      qs.stringify(params)
    );
  },
  addField(params){
    return axios.post(
      `${base.bd}/admin/bd_field/saveadd`,
      qs.stringify(params)
    );
  },
  getBdMsgLists(params){
    return axios.post(
      `${base.bd}/admin/bd_msg/lists`,
      qs.stringify(params)
    );
  },
  delBdMsg(params){
    return axios.post(
      `${base.bd}/admin/bd_msg/del`,
      qs.stringify(params)
    );
  },
  saveEditBdMsg(params){
    return axios.post(
      `${base.bd}/admin/bd_msg/saveedit`,
      qs.stringify(params)
    );
  },
  getFieldForm(params){
    //获取表单字段
    return axios.post(
      `${base.bd}/admin/bd_msg/field`,
      qs.stringify(params)
    );
  },
  addFieldForm(params){
    //添加 表单字段
    return axios.post(
      `${base.bd}/admin/bd_msg/saveadd`,
      qs.stringify(params)
    );
  },
  editFieldForm(params){
    //修改 表单字段
    return axios.post(
      `${base.bd}/admin/bd_msg/saveedit2`,
      qs.stringify(params)
    );
  }
};
export default getForm;
